package com.itheima.junit;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.ArrayList;

public class Demo1 {

    @Test
    public void method(){
        int a = 10;
        a = a / 0;
        System.out.println(a);
    }

    @Test
    public void method1(){
        int a = 10;
        a = a / 0;
        System.out.println("a = " + a);
    }

    @Before
    public void method2(){
        ArrayList<String> list = new ArrayList();
        list.add("122");
        list.add("222");
        list.add("333");
        for (String s : list) {
            list.add("444");
        }
    }

    @Test
    public void method3(){
        int a = 10;
        int b = 20;
        System.out.println("b = " + b);
        System.out.println("a = " + a);
    }

    @After
    public void method4(){
        int[] arr = {1,2,3};
        int a = arr[1];
        System.out.println("a = " + a);
    }
}
